import request from '@/utils/request'

// 查询会员列表
export function listMember(query) {
  return request({
    url: '/shop/member/list',
    method: 'get',
    params: query
  })
}

// 更新会员信息
export function updateMember(data) {
  return request({
    url: '/shop/member',
    method: 'put',
    data: data
  })
}

// 查询会员详细
export function getMember(memberId) {
  return request({
    url: '/shop/member/' + memberId,
    method: 'get'
  })
}

// 充值/扣除   余额
export function addBalance(data) {
  return request({
    url: '/shop/member/pcRechargeAmount',
    method: 'post',
    data: data
  })
}

// userwthdrawal/records/list  提现列表
export function getWthdrawalList(query) {
  return request({
    url: '/userwthdrawal/records/list',
    method: 'get',
    params: query
  })
}

// userwthdrawal/records/  审核
export function wthdrawalExamine(data) {
  return request({
    url: '/userwthdrawal/records/handleUserWithdrawalRecord',
    method: 'post',
    data: data
  })
}


// 获取团员信息
export function getAllMemeberByPhone(data) {
  return request({
    url: '/shop/member/getAllMemeberByPhone',
    method: 'get',
    params: data
  })
}

// 导出团员信息
export function exporAllMemeberByPhone(data) {
  return request({
    url: '/shop/member/exporAllMemeberByPhone',
    method: 'get',
    params:data,
    responseType: 'blob'
  })
}

// 充值/扣除积分
export function pcRechargePointsDeductPoints(reqData) {
  return request({
    url: "/shop/member/pcRechargePointsDeductPoints",
    method: "post",
    data: reqData,
  });
}



// 获取用户详情页余额总数
export function getSumAllUserKtxAndpoints() {
  return request({
    url: "/shop/member/getSumAllUserKtxAndpoints",
    method: "get"
  });
}

// 获取提现详情页余额总数
export function getuserwthdrawalSum() {
  return request({
    url: "/userwthdrawal/records/getuserwthdrawalSum",
    method: "get"
  });
}

// 获取充值总额
export function getRechargeSum() {
  return request({
    url: "/shop/member/getTodayRechargeRecordsTotal",
    method: "get"
  });
}


// 获取充值记录
export function getRechargeList(reqData) {
  return request({
    url: "/shop/member/adminRechargeRecordsList",
    method: "get",
    params:reqData
  });
}

// 获取收益列表
export function getPersonalBenefitsList(reqData) {
  return request({
    url: "/shop/member/getPersonalBenefitsList",
    method: "get",
    params:reqData
  });
}

// 导出收益列表
export function exporPersonalBenefitsList(params){
  return request({
    url: '/shop/member/exporPersonalBenefitsList',
    method: 'get',
    params,
    responseType: 'blob',
  })
}

// 导出充值记录列表
export function exporCgOrderListtData(params){
  return request({
    url: '/shop/member/exporadminRechargeRecordsList',
    method: 'get',
    params,
    responseType: 'blob',
  })
}


// 导出提现记录列表
export function exporUserwthdrawalrecordsList(params){
  return request({
    url: '/userwthdrawal/records/exporUserwthdrawalrecordsList',
    method: 'get',
    params,
    responseType: 'blob',
  })
}


// 下载会员收益列表
export function exporadminRechargeRecordsByUserIdList(params){
  return request({
    url: '/shop/member/exporadminRechargeRecordsByUserIdList',
    method: 'get',
    params,
    responseType: 'blob',
  })
}


// 重置密码
export function resetPassword(reqData) {
  return request({
    url: "/shop/member/pcUserIdPasswordresetting",
    method: "post",
    params: reqData,
  });
}


// 重置签名
export function pcUserIdResettingSign(reqData) {
  return request({
    url: "/shop/member/pcUserIdResettingSign",
    method: "post",
    params: reqData,
  });
}